<template>
  <Header title="地址管理"></Header>
  <van-address-list
    v-model="chosenAddressId"
    :list="addressList"
    :disabled-list="disabledList"
    disabled-text="以下地址超出配送范围"
    default-tag-text="默认"

    @add = "add()"
  >
  </van-address-list>
</template>
    <!-- list-item-class="custom-address-item" -->
<script setup>
import { userStore } from '@/store/UserStore';
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const store = userStore();
const addressList = store.addressList;
const disabledList = store.disabledList;
const chosenAddressId = ref('1');

function add() {
  router.push('/addressEdit');
}
</script>


<style>
.van-address-item__name{
  font-size: 10px;
  color: red;
}
</style>

<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter()
    function goBack() {
    router.push('./my')
  }
</script>
<!-- <template>
    <div class="addressmanagement">
      <div class="header">
        <div class="backicon">
          <span style="font-size: 8vw;" @click="goBack()">←</span>
        </div>
        <div class="title" style="font-size: 5vw;">地址管理</div>
      </div>
      <div class="addressitem">
        <div class="addressinfo">
          <div class="namephone">
            <span style="font-size: 5vw;">大钊  </span>
            <span style="font-size: 4vw;">13123456731</span>
          </div>
          <div class="addressdetail" style="font-size: 5vw;">广东省广州市天河区asd</div>
        </div>
        <div class="editicon">
          <span style="font-size: 5vw;">✏</span>
        </div>
      </div>
      <div class="addressitem">
        <div class="addressinfo">
          <div class="namephone">
            <span style="font-size: 5vw;">阿钊  </span>
            <span style="font-size: 4vw;">13123456731</span>
          </div>
          <div class="addressdetail" style="font-size: 5vw;">广东省广州市天河区asd</div>
        </div>
        <div class="editicon">
            
          <span style="font-size: 5vw;">✏</span>
        </div>
      </div>
      <button class="addbutton" style="font-size: 5vw;">新增地址</button>
    </div>
  </template>
  
  
  <style scoped>
  .addressmanagement {
    padding: 15px;
    background-color: white;
  }
  
  .header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
  }
  
  .backicon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5%;
  }
  
  .title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
  }
  
  .addressitem {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .addressinfo {
    display: flex;
    flex-direction: column;
  }
  
  .namephone {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
  }
  
  .addressdetail {
    color: #666;
  }
  
  .editicon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .addbutton {
    width: 100%;
    padding: 10px;
    background-color: #ffc107;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
  }
  </style>


<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter()
    function goBack() {
    router.push('./my')
  }
</script>
 -->